<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>编辑个人信息</title>
    <link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.min.css' %}">
    <link rel="stylesheet" href="{% static 'css/user_center.css' %}">
    <link rel="stylesheet" href="{% static 'css/head.css' %}">
    <link rel="stylesheet" href="{% static 'css/file.css' %}">
</head>
<body>
    <div class="nav_head">
        {% if request.session.username|default:'' != '' %}
            <p>欢迎您，{{ request.session.username }}</p>
            <button class="btn btn-default"><a href="/user/logout">退出</a></button>
        {% else %}
            <a class="btn btn-link" href="/user/login">登陆</a>
            <a class="btn btn-link" href="/user/register">注册</a>
        {% endif %}
        <div class="nav dropdown">
            <a class="btn btn-link" href="/user/user_center">| 用户中心</a>
        </div>
        <div class="nav">
            <a class="btn btn-link" href="/">首页</a>
        </div>
    </div>
    <div class="title">
        <img src="{% static 'img/title.png' %}">
    </div>
    <!-- 返回最上开始 -->
    <div class="back_to_top">
        <a href="#"><img src="{% static 'img/index-回到最上.png' %}"></a>
    </div>
    <!-- 返回最上结束 -->
    <div class="container">
        <h1 class="text-center">编辑个人信息</h1>
        <form method="post">
            {% csrf_token %}
            <div class="form-group">
                <label for="phone">电话:</label>
                <input type="text" class="form-control" id="phone" name="phone" value="{{ user.phone|default:'' }}">
            </div>
            <div class="form-group">
                <label for="email">邮箱:</label>
                <input type="email" class="form-control" id="email" name="email" value="{{ user.email|default:'' }}">
            </div>
            <div class="form-group">
                <label for="description">个人描述:</label>
                <textarea class="form-control" id="description" name="description">{{ user.description|default:'' }}</textarea>
            </div>
            <button type="submit" class="btn btn-primary">确认</button>
        </form>
    </div>

    <script src="{% static 'js/jquery-3.3.1.min.js' %}"></script>
    <script src="{% static 'js/bootstrap.min.js' %}"></script>
    <script src="{% static 'js/user_center.js' %}"></script>
    <script src="{% static 'js/file.js' %}"></script>
    {% include 'includes/websocket.html' %}
</body>
</html>